package com.etc.controller;

import com.etc.entity.Room;
import com.etc.entity.Type;
import com.etc.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * (Type)表控制层
 *
 * @author makejava
 * @since 2021-10-18 21:07:18
 */
@Controller
@RequestMapping("room")
public class RoomController {
    /**
     * 服务对象
     */
    @Autowired
    TypeService service;
    /**
     * 查询所以直播间
     * @return
     */
    @RequestMapping("queryType")
    @ResponseBody
    public List<Type> queryType(){
        List<Type> list = service.queryType();
        return list;
    }


    /**
     * 按类型查询所以直播间
     * @return
     */
    @RequestMapping("getQueryType")
    @ResponseBody
    public List<Room> queryRoomListById1(@RequestParam(value = "typeId") String typeId){
        List<Room> list = service.queryRoomListById(typeId);
        return list;
    }
}

